package shortlink.common.convention.exception;

import shortlink.common.convention.errorcode.BaseErrorCode;
import shortlink.common.convention.errorcode.IErrorCode;

public class ServiceException extends AbstractException{
    public ServiceException(String message) {
        this(message,null, BaseErrorCode.SERVICE_ERROR);
    }
    public ServiceException(IErrorCode errorCode) {this(null,errorCode);}
    public ServiceException(String message,IErrorCode errorCode) {this(message,null,errorCode);}
    public ServiceException(String message, Throwable throwable, IErrorCode errorCode) {
        super(message, throwable, errorCode);
    }

    @Override
    public String toString() {
        return "ServiceException{" +
                "errorCode='" + errorCode +
                ", errorMessage='" + errorMessage  +
                '}';
    }
}
